<template>
	<view class="table">
		<view class="table_header">
			<view> 月份 </view>
			<view> 货款 </view>
			<view> 实{{type=='0'?"收":"付"}}款 </view>
			<view> 优惠 </view>
			<view> 应{{type=='0'?"收":"付"}}款 </view>
			<view> </view>
		</view>
		<view v-if="data.length>0" class="table_body" v-for="(item, index) in data" :key="index">
			<view> {{ item ? item.orderDay : "0" }} </view>
			<view> {{ item ? item.orderAmt : "0" }} </view>
			<view> {{ item.realAmt ? item.realAmt : "0" }} </view>
			<view>
				{{ item.orderDiscountAmt ? item.orderDiscountAmt : "0" }}
			</view>
			<view> {{ (item.orderAmt*1000-item.realAmt*1000-item.orderDiscountAmt*1000)/1000 }} </view>
			<view v-if="type=='0'" @tap="skip(`/pages/financial/detailsInfo?cid=${cid}&orderDay=${item.orderDay}`)">>
			</view>
			<view v-else @tap="skip(`/pages/financial/detailsOut?sid=${sid}&orderDay=${item.orderDay}`)">></view>
		</view>
		<view class="" v-else>
			~暂无数据~
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: ["data", "type", 'cid', 'sid'],

	};
</script>

<style lang="scss" scoped>
	.table {
		min-height: 300rpx;

		.table_header,
		.table_body {
			display: grid;
			text-align: center;
			grid-template-columns: 1fr 1fr 1fr 1fr 1fr 20rpx;
			border-bottom: 1px solid #bdbdbd;
		}

		.table_header {
			font-size: 30rpx;
			border-bottom: 1px solid #bdbdbd;

			view {
				height: 80rpx;
				line-height: 80rpx;
			}
		}

		.table_body {
			view {
				display: flex;
				justify-content: center;
				align-items: center;
				min-height: 60rpx;
				white-space: normal;
				word-break: break-all;
				// line-height: 60rpx;
				// max-width: 100rpx;

				overflow: auto;
				// border-left: 1px solid #eee;
				// border-bottom: 1px solid #eee;
				// border-right: 1px solid #eee;
			}
		}
	}
</style>